<template>
  <el-dialog title="参数配置" :visible.sync="dialogVisible" width="30%">

    <el-form ref="form" size="mini" :model="form" label-width="50px">
      <el-form-item label="单位">
        <el-input v-model="form.unit" placeholder="请输入单位"></el-input>
      </el-form-item>
    </el-form>

    <span slot="footer" class="dialog-footer">
      <el-button @click="dialogVisible = false" size="mini">取 消</el-button>
      <el-button type="primary" @click="submit()" size="mini">确 定</el-button>
    </span>
  </el-dialog>
</template>
<script>
  export default {
    data() {
      return {
        dialogVisible: false,
        form: {
          data: '',
          unit: '',
        },
        type: ''
      }
    },
    methods: {
      init(type, row) {
        this.type = type
        this.form = Object.assign(this.form, row)
        this.dialogVisible = true
      },

      submit() {
        this.$emit('paramsSet', {
          type: this.type,
          data: this.form
        })
        this.dialogVisible = false
      },
    },
  }
</script>
<style scoped>

</style>